<div class="layui-fluid">
<div class="layui-breadcrumb jy-breadcrumb">

</div>

<div class="layui-tab" lay-filter="showInfo" style="background-color:#FFFFFF">
  <ul class="layui-tab-title">
    <li class="layui-this" lay-id="1">资料包审核</li>
    <li lay-id="2">样品审核</li>
    <li lay-id="3">新品分派</li>
    <li lay-id="4">编辑审核</li>
    <li lay-id="5">图片审核</li>
  </ul>
  <input type="hidden" id='tabtype' value='1'>
  <div class="layui-tab-content" style="background-color:#FFFFFF">
    <div class="layui-tab-item layui-show">
      <div class="layui-row layui-col-space5 detail detail1">
        <div class="layui-col-md12">
          <div class="layui-card layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form-1">
            <div class="layui-inline">
                <label class="layui-form-label">SKU</label>
                <div class="layui-input-inline">
                  <input type="text" name="sku" autocomplete="off" placeholder="多个用空格或逗号隔开" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">开发人员</label>
                <div class="layui-input-inline">
                    <select name="developer" xm-select="user" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
<!--             <div class="layui-inline">
                <label class="layui-form-label">对接人员：</label>
                <div class="layui-input-inline">
                    <select name="buttman" xm-select="user1" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div> -->
            <div class="layui-inline">
                <label class="layui-form-label">审核状态</label>
                <div class="layui-input-inline">
                    <select name="status" type="select" xm-select="select1"></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="time" id="time1" placeholder=" - ">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接类型</label>
                <div class="layui-input-inline">
                  <input type="text" name="handovertype" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">审核日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="audittime" id="time4" placeholder=" - ">
                </div>
            </div>
            <br/>
            <div class="layui-inline" style="padding-left:3%">
                <button type="button" class="layui-btn searchbtn1" lay-submit lay-filter="LAY-list-search">查询</button>
                <button type="button" class="layui-btn layui-btn-primary tabreset">重置</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md12 ">
            <div class="layui-card" >
                <div class="layui-form" lay-filter="batchOp-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <select lay-filter="batchOp">
                                <option value="0" selected>批量操作</option>
                                <option value="1">导出数据</option>
                                <option value="2">导入数据</option>
                            </select>
                        </div>
                    </div>
                </div>
                <table id="LAY-list-normal1"  lay-filter="LAY-list-normal1"></table>
            </div>
            <script type="text/html" id="subTableHtml1">
                <table class="subTable diyTable">
                    <tbody>
                    <tr>
                        <td>开发人员</td>
                        <td>{{d.developer||''}}</td>
                        <td>品牌Logo</td>
                        <td>{{d.logo||''}}</td>
                        <td>销售数量/单位</td>
                        <td>{{d.quantityunit||''}}</td>
                        <td>开发链接</td>
                        <td><a class="blue" href="{{d.develop_link||''}}"  target="_blank">点击跳转</a></td>
                    </tr>
                    <tr>
                        <td>调研链接</td>
                        <td ><a class="blue" href="{{d.research_links||''}}"  target="_blank">点击跳转</a></td>
                        <td>交接类型</td>
                        <td>{{d.type||''}}</td>
                        <td>是否授权</td>
                        <td>{{d.authorization_name||''}}</td>
                        <td>打包前尺寸</td>
                        <td>{{d.aslengthaswideashight||''}}</td>
                    </tr>
                    <tr>
                        <td>交接备注</td>
                        <td colspan="7">{{d.develop_remarks||''}}</td>
                    </tr>
                    </tbody>
                </table>
            </script>
            <script type="text/html" id="operation1">
                {{# if(d.status==1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="audit" data-mark='audit'>审核</a>
                {{# } }}
            </script>
        </div>
      </div>
    </div>
    <div class="layui-tab-item">
      <div class="layui-row layui-col-space15 detail detail2">
        <div class="layui-col-md12">
          <div class="layui-card layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form-2">
            <div class="layui-inline">
                <label class="layui-form-label">SKU</label>
                <div class="layui-input-inline">
                  <input type="text" name="sku" autocomplete="off" placeholder="多个用空格或逗号隔开" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">开发人员</label>
                <div class="layui-input-inline">
                    <select name="developer" xm-select="user3" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                  <!-- <input type="text" name="developer" autocomplete="off" placeholder="" class="layui-input"> -->
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">归还人员</label>
                <div class="layui-input-inline">
                    <select name="returnpeople" xm-select="user13" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                  <!-- <input type="text" name="developer" autocomplete="off" placeholder="" class="layui-input"> -->
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">归还日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="returntime" id="time5" placeholder=" - ">
                </div>
            </div>
<!--             <div class="layui-inline">
                <label class="layui-form-label">对接人员：</label>
                <div class="layui-input-inline">
                    <select name="buttman" xm-select="user4" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div> -->
            <div class="layui-inline">
                <label class="layui-form-label">审核状态</label>
                <div class="layui-input-inline">
                    <select name="status" type="select" xm-select="select2"></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">审核日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="audittime" id="time2" placeholder=" - ">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接类型</label>
                <div class="layui-input-inline">
                  <input type="text" name="handovertype" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline" style="padding-left:3%">
                <button type="button" class="layui-btn searchbtn2" lay-submit lay-filter="LAY-list-search">查询</button>
                <button type="button" class="layui-btn layui-btn-primary tabreset">重置</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-form" lay-filter="batchOp-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <select lay-filter="batchOp" >
                                <option value="0" selected>批量操作</option>
                                <option value="1">导出数据</option>
                                <option value="2">导入数据</option>
                            </select>
                        </div>
                    </div>
                </div>
                <table id="LAY-list-normal2"  lay-filter="LAY-list-normal2"></table>
            </div>
            <script type="text/html" id="subTableHtml2">
                <table class="subTable diyTable">
                    <tbody>
                    <tr>
                        <td>开发人员</td>
                        <td>{{d.developer||''}}</td>
                        <td>品牌Logo</td>
                        <td>{{d.logo||''}}</td>
                        <td>销售数量/单位</td>
                        <td>{{(d.quantity+d.quantity_unit)||''}}</td>
                        <td>样品数量</td>
                        <td >{{d.production_type_num||''}}</td>
                    </tr>
                    <tr>
                        <td>是否授权</td>
                        <td>{{d.authorization_name||''}}</td>
                        <td>交接类型</td>
                        <td>{{d.type||''}}</td>
                        <td>审核备注</td>
                        <td colspan="3">{{d.haudit_remarks||''}}</td>
                    </tr>
                    </tbody>
                </table>
            </script>
            <script type="text/html" id="auditHtml">
                <div class="layui-card layui-form" lay-filter="LAY-list-form1">
                    <div class="layui-form-item">
                        <label class="layui-form-label">审核</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="2" title="通过" checked="">
                            <input type="radio" name="status" value="3" title="驳回">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">备注</label>
                        <div class="layui-input-block" style="padding: 0px 0px 10px 0px">
                            <input type="text" name="remarks" autocomplete="off" placeholder="" class="layui-input" style="width:400px">
                        </div>
                    </div>
                    <div class="layui-inline" style="display:none;" id='grade'>
                        <label class="layui-form-label">图片等级</label>
                        <div class="layui-input-block" style="padding: 0px 0px 10px 0px">
                            <input type="text" name="auditimggrade" autocomplete="off" placeholder="" class="layui-input" style="width:400px">
                        </div>
                    </div>
                </div>
            </script>
            <script type="text/html" id="operation2">
                {{# if(d.status==1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="audit" data-mark='audit'>审核</a>
                {{# } }}
                {{# if(d.sample_status==1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="sample">样品</a>
                {{# } }}
            </script>
        </div>
      </div>
    </div>
    <div class="layui-tab-item">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form-3">
            <div class="layui-inline">
                <label class="layui-form-label">SKU</label>
                <div class="layui-input-inline">
                  <input type="text" name="sku" autocomplete="off" placeholder="多个用空格或逗号隔开" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">编辑人员</label>
                <div class="layui-input-inline">
                    <select name="describeoperator" xm-select="user5" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">图片人员</label>
                <div class="layui-input-inline">
                  <select name="imgoperator" xm-select="user6" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">开发人员</label>
                <div class="layui-input-inline">
                  <select name="developer" xm-select="user14" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接类型</label>
                <div class="layui-input-inline">
                  <input type="text" name="htype" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">描述等级</label>
                <div class="layui-input-inline">
                  <input type="text" name="editgrade" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">图片等级</label>
                <div class="layui-input-inline">
                  <input type="text" name="imggrade" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">制作类型</label>
                <div class="layui-input-inline">
                    <select name="productiontype">
                        <option value=""></option>
                        <option value="1">资料包</option>
                        <option value="2">样品</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-inline">
                    <select name="assignstatus">
                        <option value=""></option>
                        <option value="1">待分派</option>
                        <option value="2">已分派</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">分派状态</label>
                <div class="layui-input-inline">
                    <!-- <select name="editimgassign" type="select" xm-select="assignselect"></select> -->
                    <select name="editimgassign">
                        <option value=""></option>
                        <option value="1">图片待分派</option>
                        <option value="2">图片已分派</option>
                        <option value="3">编辑待分派</option>
                        <option value="4">编辑已分派</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">编辑分派日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="editassigntime" id="time6" placeholder=" - ">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">图片分派日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="imgassigntime" id="time7" placeholder=" - ">
                </div>
            </div>
            <br/>
            <div class="layui-inline" style="padding-left:3%">
                <button type="button" class="layui-btn searchbtn3" lay-submit lay-filter="LAY-list-search">查询</button>
                <button type="button" class="layui-btn layui-btn-primary tabreset">重置</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                    <div class="layui-form" lay-filter="batchOp-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <select lay-filter="batchOp" >
                                <option value="0" selected>批量操作</option>
                                <option value="1">导出数据</option>
                                <option value="2">导入数据</option>
                                <option value="3">驳回到交接</option>
                            </select>
                        </div>
                    </div>
                </div>
                <table id="LAY-list-normal3"  lay-filter="LAY-list-normal3"></table>
            </div>
            <script type="text/html" id="operation3">
                {{# if(d.img_operator==null && d.assign_status==1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="img">图片</a>
                {{# } }}
                {{# if(d.edit_operator==null && d.assign_status==1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                {{# } }}
            </script>
        </div>
      </div>
    </div>
    <div class="layui-tab-item bj">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form-4">
            <div class="layui-inline">
                <label class="layui-form-label">SKU</label>
                <div class="layui-input-inline">
                  <input type="text" name="sku" autocomplete="off" placeholder="多个用空格或逗号隔开" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">SPU</label>
                <div class="layui-input-inline">
                  <input type="text" name="spu" autocomplete="off" placeholder="多个用空格或逗号隔开" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">开发人员</label>
                <div class="layui-input-inline">
                  <select name="developer" xm-select="user7" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">审核状态</label>
                <div class="layui-input-inline">
                    <select name="status" id="bjstatus" type="select" xm-select="select3"></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">编辑人员</label>
                <div class="layui-input-inline">
                  <select name="operator" xm-select="user8" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">描述等级</label>
                <div class="layui-input-inline">
                  <input type="text" name="grade" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接类型</label>
                <div class="layui-input-inline">
                  <input type="text" name="handovertype" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">审核日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="audittime" id="time3" placeholder=" - ">
                </div>
            </div>
            <div class="layui-inline" style="padding-left:3%">
                <button type="button" class="layui-btn searchbtn4" lay-submit lay-filter="LAY-list-search">查询</button>
                <button type="button" class="layui-btn layui-btn-primary tabreset">重置</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                    <div class="layui-form" lay-filter="batchOp-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <select lay-filter="batchOp" >
                                <option value="0" selected>批量操作</option>
                                <option value="1">导出数据</option>
                                <option value="2">导入数据</option>
                            </select>
                        </div>
                    </div>
                </div>
                <table id="LAY-list-normal4"  lay-filter="LAY-list-normal4"></table>
            </div>
            <script type="text/html" id="editimg">
               <div class="layui-card layui-form" lay-filter="LAY-list-form3">
                    <div class="layui-form-item">
                        <label class="layui-form-label">SKU</label>
                        <div class="layui-input-block">
                            <input type="text" name="assign_sku" value="'+data.sku+'" autocomplete="off" placeholder="" class="layui-input" style="width:180px" disabled=disabled>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">'+title+'人员</label>
                        <div class="layui-input-block" style="padding: 0px 0px 10px 0px"><select name="operatorS" xm-select="user10" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                        </div>
                    </div>
                </div> 
            </script>
            <script type="text/html" id="operation4">
                {{# if(d.audit_statusid==1){ }}
                <a class="layui-btn layui-btn-xs" href="/#/Newproductaudit/editAudit/id={{d.id}}" >审核</a>
                {{# } }}
            </script>
        </div>
      </div>
    </div>
    <div class="layui-tab-item">
      <div class="layui-row layui-col-space15 detail detail5">
        <div class="layui-col-md12">
          <div class="layui-card layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form-5">
            <div class="layui-inline">
                <label class="layui-form-label">图片人员</label>
                <div class="layui-input-inline">
                  <select name="operator" xm-select="user9" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">SKU</label>
                <div class="layui-input-inline">
                  <input type="text" name="sku" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-inline">
                    <select name="status" type="select" xm-select="select4"></select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">交接类型</label>
                <div class="layui-input-inline">
                  <input type="text" name="handovertype" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">图片等级</label>
                <div class="layui-input-inline">
                  <input type="text" name="grade" autocomplete="off" placeholder="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">审核日期</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" name="audittime" id="time8" placeholder=" - ">
                </div>
            </div>
            <br/>
            <div class="layui-inline" style="padding-left:3%">
                <input type="hidden" name="tabtype" value="img">
                <button type="button" class="layui-btn searchbtn5" lay-submit lay-filter="LAY-list-search">查询</button>
                <button type="button" class="layui-btn layui-btn-primary tabreset">重置</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                    <div class="layui-form" lay-filter="batchOp-form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <select lay-filter="batchOp" >
                                <option value="0" selected>批量操作</option>
                                <option value="1">导出数据</option>
                                <option value="2">导入数据</option>
                            </select>
                        </div>
                    </div>
                </div>
                <table id="LAY-list-normal5"  lay-filter="LAY-list-normal5"></table>
            </div>
            <script type="text/html" id="subTableHtml5">
                {{# if(d.img) for (var i=0;i<d.img.img.length;i++){ }}
                    <div style="float: left;margin: 0px 20px;padding: 20px"><img class="doCarousel" src="{{d.img.img[i]}}" ><br/><div>{{d.img.name[i]}}</div></div>
                {{# } }}
            </script>
            <script type="text/html" id="operation5">
                {{# if(d.audit_statusid==1 || d.audit_statusid==3){ }}
                <a class="layui-btn layui-btn-xs" lay-event="audit" data-mark='img'>审核</a>
                {{# } }}
            </script>
            <script type="text/html" id="LAY-list-toolbar">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
                {{# if(d.status==1){ }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="enable">禁用</a>
                {{# }else if(d.status==2){ }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="disable">启用</a>
                {{# } }}
            </script>
        </div>
      </div>
    </div>
  </div>


</div> 
</div>
<script type="text/html" id="imgOpen">
    <div class="layui-carousel" id="carousel">
        <div carousel-item>
            {{# layui.each(d.src, function(k, v){ }}
            <div class="forcat " style='background-image: url("{{v}}")' ></div>
            {{# })  }}
        </div>
        </div>
</script>

<style>
    .forcat{
        width: 100%;
        height: 250px;
        overflow: hidden;
        background-position:50% 50%; /*图片上下左右居中*/
        background-size:contain; /*保持图像本身的宽高比例，将图片缩放到宽度或高度正好适应定义背景的区域*/
        background-repeat:no-repeat; /*图像不重复显示*/
    }
</style>
<script>
    layui.use(['admin', 'table', 'form', 'toolJ', 'upload','formSelects', 'laydate', 'element', 'laytpl','carousel'], function () {
        var $ = layui.$
            , admin = layui.admin
            // , view = layui.view
            , table = layui.table
            , toolJ = layui.toolJ
            , form = layui.form
            , carousel = layui.carousel
            , upload = layui.upload
            , laydate = layui.laydate
            , element = layui.element
            , laytpl = layui.laytpl
            , formSelects = layui.formSelects;

        formSelects.render();
        form.render(null);
        layui.$("div[lay-filter='batchOp-form'] dd[lay-value=0]").remove();
        // form.render(null, 'LAY-list-form');
        for (i = 1; i <= 8; i++) { 
            laydate.render({ elem: '#'+('time'+i) ,range: true });
        }

        for (i = 1; i <= 4; i++) { 
            toolJ.formSelectsArr(layui.data(layui.setter.tableName).auditStatus,('select'+i));
        }
        // toolJ.formSelectsArr({1:"图片待分派",2:"图片已分派",3:"编辑待分派",4:"编辑已分派"},('assignselect'));
        toolJ.formSelectsArr(layui.data(layui.setter.tableName).auditStatus, 'select3',[1]);
        $('.tabreset').click(function(){
            var url = window.location.toString();
            location = url.split('#')[0]+'#'+url.split('#')[1]+'#'+$("#tabtype").val()+Math.ceil(Math.random()*10);
        });

        var url = window.location.toString();
        var tablayid = url.split('#')[2];
        if(tablayid){
            tablayid = tablayid.slice(0, 1);
            element.tabChange('showInfo', tablayid);
            $("#tabtype").val(tablayid);
            $('.searchbtn'+tablayid).click();
        }

        element.on('tab(showInfo)', function () {
            var layid = $(this).attr('lay-id');
            $("#tabtype").val(layid);
            $('.searchbtn'+layid).click();
        });

        //批量操作
        form.on('select(batchOp)', function(datas){
            switch (datas.value) {
                case '1':
                    //列表导出
                    switch ($("#tabtype").val()) {
                        case '1':
                            var url = '/index/Newproductaudit/exportDatagramList'; //资料包审核
                            var type = 1;
                            break;
                        case '2':
                            var url = '/index/Newproductaudit/exportSampleList'; //样品审核
                            var type = 2;
                            break;
                        case '3':
                            var url = '/index/Newproductaudit/exportNewProductAssignList'; //新品分派
                            var type = 'new';
                            break;
                        case '4':
                            var url = '/index/Newproductaudit/exportEditAuditList'; //编辑审核
                            var type = 'edit';
                            break;
                        case '5':
                            var url = '/index/Newproductaudit/exportImgAuditList'; //图片审核
                            var type = 'img';
                            break;
                    }

                    var data = form.val("LAY-list-form-"+$("#tabtype").val());
                    data.type = type;
                    toolJ.ajax({"data": data, 'url': url});
                    break;
                case '2':
                    //列表导入
                    switch ($("#tabtype").val()) {
                        case '1':
                            var url = '/index/Newproductaudit/uploadDatagramListInfo'; //资料包
                            var template = '/attachment/importcvs/manufacturedatagram.csv'; 
                            break;
                        case '2':
                            var url = '/index/Newproductaudit/uploadSampleListInfo'; //样品
                            var template = '/attachment/importcvs/manufacturesample.csv'; 
                            break;
                        case '3':
                            var url = '/index/Newproductaudit/uploadNewProductAssignInfo'; //新品
                            var template = '/attachment/importcvs/newproduct.csv'; 
                            break;
                        case '4':
                            var url = '/index/Newproductaudit/uploadEditAuditInfo'; //编辑
                            var template = '/attachment/importcvs/editimgaudit.csv'; 
                            break;
                        case '5':
                            var url = '/index/Newproductaudit/uploadImgAuditInfo'; //图片
                            var template = '/attachment/importcvs/editimgaudit.csv'; 
                            break;
                    }
                    toolJ.upload(url, template);
                    break;
                case '3':
                    switch ($("#tabtype").val()) {
                        case '3':
                            //驳回到交接
                            var url = '/index/Newproductaudit/deleteAudit';
                            var template = '/attachment/importcvs/deleteaudit.csv';
                            break;
                    }
                    toolJ.upload(url, template);
                    break;
            }
            datas.elem.value=0;
            form.render(null, 'batchOp-form');
            layui.$("div[lay-filter='batchOp-form'] dd[lay-value=0]").remove();
        });

        viewTable();
        //监听搜索
        layui.form.on('submit(LAY-list-search)', function (data) {
            var field = data.field;
            viewTable(field);
        });

        function  viewTable(field = {}) {
            switch ($("#tabtype").val()) {
                case '1':
                    field.type = 1;
                    var param = [
                        {
                            field: '', 
                            title: '<i class="layui-icon layui-colla-icon layui-icon-right collapseAll pointer"></i>',
                            event: 'collapse',
                            width: 50, 
                            align: 'center', 
                            templet: function (d) {
                                return '<i style="" class="layui-icon layui-colla-icon layui-icon-right pointer"></i>';
                            }
                        }
                        , {field: 'sku', title: 'SKU'}
                        , {field: 'spu', title: 'SPU'}
                        , {field: 'name', title: '采购名称'}
                        , {field: 'creation_time', title: '交接时间'}
                        , {field: 'img_grade', title: '图片等级'}
                        , {field: 'status_name', title: '审核状态'}
                        , {field: 'auditor', title: '审核人'}
                        , {field: 'audit_time', title: '审核时间'}
                        , {field: 'remarks', title: '审核备注'}
                        , {fixed: 'right', title:'操作', toolbar: '#operation1', width:70}
                    ];
                    var url = 'Newproductaudit/getDatagramList';
                    break;
                case '2':
                    field.type = 2;
                    var param = [
                        {
                            field: '', 
                            title: '<i class="layui-icon layui-colla-icon layui-icon-right collapseAll pointer"></i>',
                            event: 'collapse',
                            width: 50, 
                            align: 'center', 
                            templet: function (d) {
                                return '<i style="" class="layui-icon layui-colla-icon layui-icon-right pointer"></i>';
                            }
                        }
                        , {field: 'sku', title: 'SKU'}
                        , {field: 'spu', title: 'SPU'}
                        , {field: 'name', title: '采购名称'}
                        , {field: 'img_grade', title: '图片等级'}
                        , {field: 'status_name', title: '审核状态'}
                        , {field: 'auditor', title: '审核人'}
                        , {field: 'audit_time', title: '审核时间'}               
                        , {field: 'sample_status_name', title: '样品状态'}
                        , {field: 'return_people', title: '归还人'}
                        , {field: 'return_time', title: '归还时间'}
                        , {field: 'develop_remarks', title: '开发备注'}
                        , {fixed: 'right', title:'操作', toolbar: '#operation2', width:120}
                    ];
                    var url = 'Newproductaudit/getSampleList';
                    break;
                case '3':
                    field.type = 'new';
                    var param = [
                        {field: 'sku', title: 'SKU'}
                        , {field: 'spu', title: 'SPU'}
                        , {field: 'name', title: '采购名称'}
                        , {field: 'developer_name', title: '开发人员'}
                        , {field: 'production_type_name', title: '制作类型'}
                        , {field: 'handover_type', title: '交接类型'}
                        , {field: 'edit_grade', title: '描述等级'}
                        , {field: 'img_grade', title: '图片等级'}
                        , {field: 'img_operator_name', title: '图片人员'}
                        , {field: 'edit_operator_name', title: '编辑人员'}
                        , {field: 'img_assign_time', title: '图片分派时间'}
                        , {field: 'edit_assign_time', title: '编辑分派时间'}
                        , {field: 'assign_status_name', title: '状态'}
                        , {fixed: 'right', title:'操作', toolbar: '#operation3', width:120}
                    ];
                    var url = 'Newproductaudit/getNewProductAssignList';
                    break;
                case '4':
                    field.type = 'edit';

                        if(layui.formSelects.value('select3','val').length==1){
                            if(layui.formSelects.value('select3','val')[0]==1){
                                field.status=1;
                            }
                        }


                    var param = [
                        {field: 'sku', title: 'SKU'}
                        , {field: 'spu', title: 'SPU'}
                        , {field: 'name', title: '采购名称'}
                        , {field: 'developer', title: '开发人员'}
                        , {field: 'handover_type', title: '交接类型'}
                        , {field: 'grade', title: '描述等级'}
                        , {field: 'operator', title: '编辑人员'}
                        , {field: 'audit_status', title: '审核状态'}
                        , {field: 'auditor', title: '审核人'}
                        , {field: 'audit_time', title: '审核时间'}
                        , {field: 'audit_remarks', title: '审核备注'}
                        , {fixed: 'right', title:'操作', toolbar: '#operation4', width:70}
                    ];
                    var url = 'Newproductaudit/getEditAuditList';
                    break;
                case '5':
                    field.type = 'img';
                    var param = [
                        {
                            field: '', 
                            title: '<i class="layui-icon layui-colla-icon layui-icon-right collapseAll pointer"></i>',
                            event: 'collapse',
                            width: 50, 
                            align: 'center', 
                            templet: function (d) {
                                return '<i style="" class="layui-icon layui-colla-icon layui-icon-right pointer"></i>';
                            }
                        }
                        , {field: 'sku', title: 'SKU'}
                        , {field: 'spu', title: 'SPU'}
                        , {field: 'name', title: '采购名称'}
                        , {field: 'quantity', title: '销售数量/单位'}
                        , {field: 'handover_type', title: '交接类型'}
                        , {field: 'grade', title: '图片等级'}
                        , {field: 'hauthorization', title: '是否授权'}
                        , {field: 'hlogo', title: '品牌Logo'}
                        , {field: 'production_type', title: '制作类型'}
                        , {field: 'operator', title: '图片人员'}
                        , {field: 'finish_time', title: '图片完成时间'}
                        , {field: 'audit_status', title: '审核状态'}
                        , {field: 'handover_remarks', title: '交接备注'}
                        , {field: 'audit_time', title: '审核时间'}
                        , {fixed: 'right', title:'操作', toolbar: '#operation5', width:70}
                    ];
                    var url = 'Newproductaudit/getImgAuditList';
                    break;
            }

            var ele = 'LAY-list-normal' + $("#tabtype").val();
            table.render({
                elem: "#" + ele
                , url: '/index/' + url
                , where: field
                , cols: [param]
                , page: true
                , limit: 50
                ,text:{none: '暂无相关数据!' }
            });
            //监听行内操作
            table.on('tool('+ele+')', function(obj){
                // debugger;
                var data = obj.data;
                switch (obj.event) {
                    case 'audit':
                        var mtype = $(this).data('mark');
                        
                        if(mtype == 'img'){
                            var height = '210px';
                            var url = '/index/Newproductaudit/updateMaterialAudit';
                        }else{
                            var height = '260px';
                            var url = '/index/Newproductaudit/updateManufactureAudit';
                        }

                        layer.open({
                            type: 1
                            ,title: '审核'
                            ,area: ['550px', height]
                            ,shade: 0.8
                            ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                            ,btn: ['保存','取消']
                            ,btn1: function(index, layero){
                                var status = $("input[name=status]:radio:checked").val();
                                var remarks = $("input[name=remarks]").val();
                                var obj = {};
                                obj.url = url;
                                obj.data = {sku:data.sku,id:data.id,status:status,remarks:remarks,type:mtype};
                                if(mtype != 'img') obj.data.grade = $("input[name=auditimggrade]").val();
                                toolJ.ajax(obj);
                                $('.searchbtn'+$("#tabtype").val()).click();
                                return false;
                            }
                            ,content: $('#auditHtml').html()
                            ,success: function(layero){
                                form.render(null, 'LAY-list-form1');

                                if(mtype == 'img') 
                                    $('#grade').hide(); 
                                else 
                                    $('#grade').show();
                            }
                          });
                        break;
                    case 'sample':
                        layer.open({
                            type: 5
                            ,title: '样品'
                            // ,closeBtn: false
                            ,area: ['350px', '160px']
                            ,shade: 0.8
                            ,id: 'LAY_sample' //设定一个id，防止重复弹出
                            ,btn: [ '保存','取消']
                            ,btn1: function(index, layero){
                                var peopleR = $("input[name=peopleR]").val();
                                var obj = {};
                                obj.url = '/index/Newproductaudit/updateSampleReturn';
                                obj.data = {people:peopleR,id:data.id};
                                toolJ.ajax(obj);
                                $('.searchbtn'+$("#tabtype").val()).click();
                                return false;
                            }
                            ,content: '<div class="layui-card layui-form" lay-filter="LAY-list-form2"><div class="layui-inline"><label class="layui-form-label">归还人：</label><div class="layui-input-block" style="padding: 10px 0px 10px 0px"><select name="peopleR" xm-select="user11" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select></div></div></div>'
                            ,success: function(layero){
                                form.render(null, 'LAY-list-form2');
                                formSelects.render();
                            }
                          });
                        break;
                    case 'collapse':
                        if($("#tabtype").val() == 1){
                            var getTpl = subTableHtml1.innerHTML;
                        }else if($("#tabtype").val() == 2){
                            var getTpl = subTableHtml2.innerHTML;
                        }else if($("#tabtype").val() == 5){
                            var getTpl = subTableHtml5.innerHTML;
                        }

                        var that=$(this);
                        laytpl(getTpl).render(data, function (html) {
                            var trObj =that.parent('tr'); //当前行
                            var accordion = false; //开启手风琴，那么在进行折叠操作时，始终只会展现当前展开的表格。
                            var content = html;
                            //表格行折叠方法
                            collapseTable({
                                elem: trObj,
                                accordion: accordion,
                                content: content,
                                success: function (trObjChildren, index) { //成功回调函数
                                    //trObjChildren 展开tr层DOM
                                    //index 当前层索引
                                    //  table.init('subTable');
                                }
                            });
                        });
                        break;
                    case 'img':
                        assign('img',data);
                        break;
                    case 'edit':
                        assign('edit',data);
                        break;
                }
            });
        }

        function assign(type,data){
            if(type == 'img'){
                var title = '图片';
                var display = 'display:none';
                var height = '210px';
            }else{
                var title = '编辑';
                var display = '';
                var height = '280px';
            }
            var title = type == 'img'?'图片':'编辑';
            layer.open({
                type: 5
                ,title: title
                ,area: ['350px', height]
                ,offset: 'auto'
                ,shade: 0.8
                // ,shadeClose: true
                ,closeBtn: 1
                ,anim: 2
                ,id: 'LAY_assign' 
                ,btn: ['保存','取消']
                ,btn1: function(index, layero){
                    var operator = $("input[name=operatorS]").val();
                    if(operator == ''){
                       layer.msg(title+'人员不可为空', {"icon": 2});
                       return false; 
                    } 
                    var datas = {id:data.id,sku:data.sku,operator:operator,type:type};
                    if(type != 'img') datas.grade = $("input[name=imgeditgrade]").val()
                    
                    $.ajax({
                        type: 'POST',
                        url: '/index/Newproductaudit/insertAssignInfo',
                        dataType: 'json',
                        data: datas,
                        success: function (data) {
                            layer.close(index1);
                            if (data.code == 1) {
                                if (data.msg) {
                                    layer.msg(data.msg, {"icon": 1});
                                }
                                layer.closeAll();
                                $('.searchbtn'+$("#tabtype").val()).click();
                            } else {
                                layer.alert(data.msg, {"icon": 2});
                                return false;
                            }                                       
                        },
                        error: function () {
                            layer.close(index1);
                            layer.alert('系统繁忙,请稍后再试!', {"icon": 2});
                            return false;
                        },
                        beforeSend: function () {
                            index1=layer.load(2, {
                                shade: [0.5, '#fff']
                            });
                        }
                    });

                    return false;
                }
                ,content: '<div class="layui-form layui-card-header layuiadmin-card-header-auto editStatus-form" lay-filter="editStatus-form"><div class="layui-form-item"><div class="layui-inline"><label class="layui-form-label">SKU：</label><div class="layui-input-inline"><input type="text" name="assign_sku" value="'+data.sku+'" autocomplete="off" placeholder="" class="layui-input gray" style="width:180px" disabled=disabled></div></div><div class="layui-inline"><label class="layui-form-label">'+title+'人员：</label><div class="layui-input-inline" style="padding: 0px 0px 10px 0px"><select name="operatorS" xm-select="user10" xm-select-search="/index/User/getUserByName" xm-select-radio=""></select></div></div><div class="layui-inline" style="'+display+'"><label class="layui-form-label">'+title+'等级：</label><div class="layui-input-inline" style="padding: 0px 0px 10px 0px"><input type="text" name="imgeditgrade" value="'+data[type+'_grade']+'" autocomplete="off" class="layui-input" style="width:180px"></div></div></div></div>'
                ,success: function(layero){
                    console.log(layero);
                    form.render(null, 'LAY-list-form3');
                    formSelects.render();
                }
            });
        }

        //明细全部展开|折叠
        $('.detail').on('click','.collapseAll',function () {
            $('.detail'+$("#tabtype").val()+' .layui-table-body tbody').eq(0).children().each(function (i) {
                if($(this).data('data-collapse')!=1){
                    if($("#tabtype").val() == 1){
                        var getTpl = subTableHtml1.innerHTML;
                    }else if($("#tabtype").val() == 2){
                        var getTpl = subTableHtml2.innerHTML;
                    }else if($("#tabtype").val() == 5){
                        var getTpl = subTableHtml5.innerHTML;
                    }
                    var that=$(this);
                    laytpl(getTpl).render(layui.table.cache['LAY-list-normal'+$("#tabtype").val()][$(this).data('index')], function (html) {
                        var trObj = that; //当前行
                        var accordion = false; //开启手风琴，那么在进行折叠操作时，始终只会展现当前展开的表格。
                        var content =html;
                        //表格行折叠方法 
                        collapseTable({
                            elem: trObj,
                            accordion: accordion,
                            content: content,
                            success: function (trObjChildren, index) { //成功回调函数
                                //trObjChildren 展开tr层DOM
                                //index 当前层索引
                                //table.init('subTable');
                            }
                        });
                    });
                }
            })
            //展开|折叠箭头图标
            $(this).toggleClass("layui-icon-right layui-icon-down");
        })

        function collapseTable(options) {
            var trObj = options.elem;
            if (!trObj) return;
            var accordion = options.accordion,
                success = options.success,
                content = options.content || '';
            var tableView = trObj.parents('.layui-table-view'); //当前表格视图
            var id = tableView.attr('lay-id'); //当前表格标识
            var index = trObj.data('index'); //当前行索引

            var colspan = trObj.find('td').length; //获取合并长度
            var trObjChildren = trObj.next(); //展开行Dom
            var indexChildren = id + '-' + index + '-children'; //展开行索引

            //不存在就创建展开行
            if (trObjChildren.data('index') != indexChildren) {
                //装载HTML元素
                var tr = '<tr data-index="' + indexChildren + '"><td colspan="' + colspan + '"><div class="" style="height: auto;">' + content + '</div></td></tr>';
                trObjChildren = trObj.after(tr).next().hide(); //隐藏展开行
            }
            //展开|折叠箭头图标
            trObj.find('td[lay-event="collapse"] i.layui-colla-icon').toggleClass("layui-icon-right layui-icon-down");
            //显示|隐藏展开行
            trObjChildren.toggle();
            //开启手风琴折叠和折叠箭头
            if (accordion) {
                trObj.siblings().find('td[lay-event="collapse"] i.layui-colla-icon').removeClass("layui-icon-down").addClass("layui-icon-right");
                trObjChildren.siblings('[data-index$="-children"]').hide(); //展开
            }
            success(trObjChildren, indexChildren); //回调函数
        }


        $("body").off("click",'.doCarousel').on('click','.doCarousel',function(){
            var index=$(this).parent().parent().find('.doCarousel').index(this);
            var src=[];
            $(this).parent().parent().find('.doCarousel').each(function(){
                src.push(this.src);
            });
            var obj={};
            obj.src=src;
            obj.now=this.src;
            var getTpl = imgOpen.innerHTML;
            laytpl(getTpl).render(obj, function (html) {
                layer.open({
                    type: 5,
                    title: '查看详情',
                    shade: [0.5, '#000'],
                    offset: 'auto',
                    area: ["90%", "85%"],
                    shadeClose: true,
                    closeBtn: 1,
                    anim: 2,
                    content: html,
                    cancel: function () {
                    }
                });
                //轮播
                carousel.render({
                    elem: '#carousel'
                    ,width: '100%' //设置容器宽度
                    ,arrow: 'hover' //始终显示箭头
                    //,full:true
                    ,autoplay:false
                        ,index:index
                    //,anim: 'updown' //切换动画方式
                    ,height:'100%'
                });
            });


        })


    });
</script>